package ru.spb.osll.myfit.client.widget;

import ru.spb.osll.myfit.common.PageElement;
import ru.spb.osll.myfit.common.PageElementType;
import ru.spb.osll.myfit.common.SetUp;
import ru.spb.osll.myfit.common.TearDown;

public class SetUpWidget extends IncludeWidget {

  
  public SetUpWidget(GWTWidgetFactory gwtWidgetFactory, SetUp setUp) {
    super(gwtWidgetFactory, setUp);
  }
 
  public SetUpWidget(GWTWidgetFactory gwtWidgetFactory, TearDown tearDown) {
    super(gwtWidgetFactory, tearDown);
  }
 
  @Override
  protected String getIncludeName() {
    
    return m_type.getKey();
  }
  
  @Override
  public PageElement getPageElement() {
    if(m_type == PageElementType.SET_UP){
      return new SetUp(includePath, includePage);
    }
    if(m_type == PageElementType.TEAR_DOWN){
      return new TearDown(includePath, includePage);
    }
    return null;
  }
}
